package com.wisdomsky.project.param.mapper;

import com.wisdomsky.project.param.pojo.Params;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ParamMapper {

    @Select({"<script>"
        +   " select "
        +   " ${params.column} "
        +   " from ${params.table} "
        +   " where status > 0 "
        +   " <if test='params.type == 1 '> "
        +   " and rid &lt; 4000 "
        +   " </if>"
        +   " <if test='params.type == 2 '> "
        +   " and rid between 4000 and 5000 "
        +   " </if>"
        +   "</script>"}
    )
    List<Params> findParamsList(@Param("params") Params params);

}
